﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

class EndGame : MenuScreen
{
    SpriteFont font;

    private Texture2D backgroundTexture;
    private Vector2 backgroundPosition;

    public EndGame()
        : base()
    {
        IsPopup = true;

        music = @"Audio/end";
    }


    /// <summary>
    /// Load the graphics content for this screen.
    /// </summary>
    public override void LoadContent()
    {
        // load the textures
        ContentManager content = ScreenManager.Game.Content;

        //font = content.Load<SpriteFont>("SpriteFont1");

        //set font on each entry menu

        backgroundTexture = content.Load<Texture2D>(@"Textures\MenuMock\congratulations");

        // calculate the texture positions
        Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
        backgroundPosition = new Vector2(
            (viewport.Width - backgroundTexture.Width) / 2,
            (viewport.Height - backgroundTexture.Height) / 2);

        // set the textures on each menu entry

        //base.LoadContent();
    }

    public override void HandleInput()
    {
        if (InputManager.IsActionTriggered(InputManager.Action.Back)
            || InputManager.IsActionTriggered(InputManager.Action.CursorDown)
            || InputManager.IsActionTriggered(InputManager.Action.CursorLeft)
            || InputManager.IsActionTriggered(InputManager.Action.CursorUp)
            || InputManager.IsActionTriggered(InputManager.Action.CursorRight)
            || InputManager.IsActionTriggered(InputManager.Action.Ok))
        {
            ScreenManager.MainMenu();
            ScreenManager.AddScreen(new CreditsScreen());
            return;
        }

        //base.HandleInput();
    }

    public override void Draw(GameTime gameTime)
    {
        SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

        spriteBatch.Begin();

        spriteBatch.Draw(backgroundTexture, backgroundPosition, Color.White);

        spriteBatch.End();
    }

}

